package com.sikaryofficial.backend;

import cn.hutool.core.date.LocalDateTimeUtil;
import com.github.houbb.sensitive.word.bs.SensitiveWordBs;
import com.sikaryofficial.backend.message.consumer.MQConsumer;
import com.sikaryofficial.backend.message.product.MQProduct;
import com.sikaryofficial.common.core.utils.SpringUtils;
import com.sikaryofficial.common.security.annotation.EnableCustomConfig;
import com.sikaryofficial.common.security.annotation.EnableRyFeignClients;
import com.sikaryofficial.common.swagger.annotation.EnableCustomSwagger2;
import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.stream.annotation.EnableBinding;

import java.util.Date;
import java.util.TimeZone;

/**
 * 处理数据
 *
 * @author qinjinyuan
 * @date 2023/10/27
 */
@EnableCustomConfig
@EnableCustomSwagger2
@EnableRyFeignClients
@SpringBootApplication
@Slf4j
@EnableBinding({MQProduct.class, MQConsumer.class})
@MapperScan(basePackages = {"com.sikaryofficial.**.mapper"})
// 开启自动解密功能
@EnableEncryptableProperties
public class HiSMKBackEndApplication {

    public static void main(String[] args) {
        SpringApplication.run(HiSMKBackEndApplication.class, args);
        log.info("(♥◠‿◠)ﾉﾞ  HISMK后台系统模块启动成功   ლ(´ڡ`ლ)ﾞ  \n" +
                " _   _ _____      ________  ___ _   __\n" +
                "| | | |_   _|    /  ___|  \\/  || | / /\n" +
                "| |_| | | |______\\ `--.| .  . || |/ / \n" +
                "|  _  | | |______|`--. \\ |\\/| ||    \\ \n" +
                "| | | |_| |_     /\\__/ / |  | || |\\  \\\n" +
                "\\_| |_/\\___/     \\____/\\_|  |_/\\_| \\_/");
        log.info("TimeZone====>" + TimeZone.getDefault().toString());
        final String text2 = "ｆｕｃｋ@126.com F#U%C^K ｆｕｃｋ GENDER the ｆｕｃｋ bad ｆｕｃｋ words.ｆｕｃｋ";
        SensitiveWordBs sensitiveWordBs =  SpringUtils.getBean(SensitiveWordBs.class);
        String result = sensitiveWordBs.replace(text2);
        log.info("敏感词接入====>" + result);
        log.info("LocalDateTimeUtil====>" + LocalDateTimeUtil.of(new Date()));
    }
}
